package lab02.test06;

public class Triangle {
    Triangle() {
    }

    //构造函数
    float a;
    float b;
    float c;
    float perimter;
    float area;
    boolean d;

    void trangle(double a, double b, double c) {
        if (a + b > c && a + c > b && b + c > a)
            d = true;
        else
            d = false;
    }


    double perimter() {
        if (d = true)
            return a + b + c;
        else System.out.println("不是三角形");
        return 0;

    }


    double area(){
        if (d=true)
            return (a*b)/2;
        else
            System.out.println("不是三角形");
        return 0;
    }

}


